import request from '../../../../../public/js/common/api/api.js'

const SysCfgUrl = Utils.CurDomain.SysCfgUrl;
const SysPlfUrl = Utils.CurDomain.SysPlfUrl;
const AccountUrl = Utils.CurDomain.AccountUrl;

const _ajaxOptions = {
    contentType: 'application/json',
    dataType: 'json',
    async: true,
    dataFilter(data, type) {
        return data;
    }
};
export default class WxcodeApi {
    static queryUserName(guid) {
        return request.get(`${AccountUrl}/account/u`);
    }

    //TODO : 注册绑定
    static registerWechat(data) {
        return request.post(AccountUrl + '/mpaccounts/register', data);
    }

    /**
     * 根据JWT获取人员信息
     * @returns 
     */
    static getUserInfo() {
        return request.get(Utils.CurDomain.SysAuthUrl + "/account/u");
    }

    /**
     * 获取手机验证码
     * @param {*} phone 
     * @returns 
     */
    static getPhoneCode(phone) {
        return request.post(`${AccountUrl}/smsmsgs/aliyun/${phone}`);
    }

    /**
     * 刷新用户组织s权限s到缓存
     * @returns 
     */
    static getReforguserpi() {
        return request.get(`${SysPlfUrl}/yyusers/refresh/pi`);
    }

    /**
     * 获取发布日志最新信息（缓存60s）
     * @returns 
     */
    static getIssuedLogs(Name) {
        return request.get(`${SysCfgUrl}/issuedlogs/last/${Name}`);
    }

    //TODO :获取用户关联员工信息
    static queryUserInfo() {
        return request.get(`${AccountUrl}/accounts/eply`);
    }

}